home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-05-25 | 1.1 KB | 70 lines | [TEXT/MACA] |
- program Untitled;
-
- const
- numbers = 39;
-
- output = 6;
-
- var
- choice : array[0..6] of integer;
- results : integer;
- loop : integer;
- times : integer;
-
-
- procedure Sortarray;
- var
- index, spot, n : integer;
-
- begin
- n := output;
- for index := 2 to n do
- begin
- choice[0] := choice[index];
- spot := index - 1;
- while choice[spot] > choice[0] do
- begin
- choice[spot + 1] := choice[spot];
- spot := spot - 1;
- end;{while}
- choice[spot + 1] := choice[0];
- end {for}
- end;
-
- procedure CheckArray;
- var
- count : integer;
-
- begin
- for count := 1 to (results - 1) do
- begin
- if choice[results] = choice[count] then
- results := results - 1;
- end;
- end;
-
-
- begin
- times := 0;
-
- while times < 10 do
- begin
- results := 0;
- randseed := tickcount;
- while results < output do
- begin
- results := results + 1;
- choice[results] := (random mod 39) + 1;
- CheckArray;
- end;
-
- SortArray;
-
- times := times + 1;
- for loop := 1 to output do
- begin
- write(choice[loop]);
- end;
- writeln;
- end;
- end. times :=